﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace DNA.Mvc.Community.Events
{
    public class NewPostEvent : EventBase
    {
        public NewPostEvent(Post post)
        {
            if ((post != null) && (post.ID > 0))
            {
                Post = post;

                if (post.IsApproved)
                {
                    if (post.IsThread)
                        this.Name = "NewThread";
                    else
                        this.Name = "ReplyPost";
                }
            }
        }

        public Post Post { get; private set; }

        public override void Raise()
        {
            if ((Post != null) && (Post.ID > 0))
            {
                base.Raise();
            }
        }
    }
}
